import { ExtensionContext, window } from 'vscode';
import { ExplorerConst } from '../../constants';
import { IExplorer } from '../../interface';
import { SystemListProvider } from './provider/system-list';

/**
 * 系统列表
 *
 * @author chitanda
 * @date 2022-12-13 10:12:40
 * @export
 * @class SystemList
 * @implements {IExplorer<IData>}
 */
export class SystemList implements IExplorer<IData> {
  readonly treeDataProvider = new SystemListProvider(this.context);

  readonly treeView = window.createTreeView<IData>(ExplorerConst.SYSTEM_LIST, {
    treeDataProvider: this.treeDataProvider,
    showCollapseAll: true,
  });

  constructor(protected readonly context: ExtensionContext) {
    context.subscriptions.push(this.treeView);
  }
}
